package main.chapter6.async

import java.util.concurrent.Executors


private val pool by lazy {
    Executors.newCachedThreadPool()
}

class AsyncTask(private val block: () -> Unit) {
    //使用线程池来执行任务
    fun execute() = pool.execute(block)
}